//
//  PathName.swift
//  MakeMoney
//
//  Created by Fan ZhiQiang on 2024/12/17.
//

import Foundation

class PathName: Codable {
    /*
    enum CodingKeys:String, CodingKey {
        case _name = "name"
        case _param = "param"
    }
    */
    var name = "PathName"
    var param: Int = 0
    
    init() {
        
    }
    
    init(param: Int) {
        self.param = param
    }
    /*
    func encode(to encoder: any Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(name, forKey: ._name)
        try container.encode(param, forKey: ._param)
    }
    
    required init(from decoder: any Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        name = try container.decode(String.self, forKey: ._name)
        param = try container.decode(Int.self, forKey: ._param)
    }
    */
}

extension PathName: Equatable {
    static func ==(lhs: PathName, rhs: PathName) -> Bool {
        lhs.name == rhs.name
    }
}

extension PathName: Hashable {
    func hash(into hasher: inout Hasher) {
        hasher.combine(name)
    }
}
